<!--
 * @Author: your name
 * @Date: 2021-08-16 11:24:24
 * @LastEditTime: 2021-08-16 11:36:50
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \briup\3-html&css\day11\04-过渡.html
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            width: 400px;
            height: 200px;
            background-color: orchid;
            margin: 10px;
        }
        
        body>div:first-child {
            /* transition使用一定要搭配hover使用 */
            transition: background 2s linear 1s;
        }
        
        body>div:first-child:hover {
            background-color: paleturquoise;
            width: 10px;
            border-radius: 50%;
        }
        
        body>div:nth-child(2) {
            transition: opacity 3s;
        }
        
        body>div:nth-child(2):hover {
            opacity: 0.3;
            cursor: pointer;
        }
    </style>
</head>

<body>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    animation与transition异同点: 1.animation需要先定义，再使用 transition直接使用 需要搭配hover才能看到效果 2.animation可以同时对多个css属性进行动画 transition单值动画效果 3.animation页面一加载就会生效 transition没有效果 4.都可以搭配hover使用

</body>

</html>